import Mock from 'mockjs';
import Banner from './banner.json'
import List from './index.json'
import Cat from './cat.json'
import Dog from './dogs.json'

//banner轮播图
Mock.mock('/api/banner','get',() => {
    return Banner
})

//首页列表数据

Mock.mock('/api/list','get',() => {
    return List
})

//获取品种

Mock.mock('/api/breed','get',(config:any) => {
    console.log(config);
    let {pet_breed} = JSON.parse(config.body);
    console.log("pet_breed",pet_breed)
    if(pet_breed == 1){
        return Dog
    }else if(pet_breed == 2){
        return Cat
    }else{
        return {data:[]}    
    } 
})